<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head th:replace="common/index :: head"></head>
	<body class="mainbody">
		<div th:replace="common/index :: location('菜单管理')"></div>
		<!-- <div th:replace="common/index :: toolbar"></div> -->
		<div th:fragment="toolbar" class="toolbar-wrap">
			<div class="toolbar">
				<div class="box-wrap">
					<a class="menu-btn"></a>
					<div class="l-list">
						<ul class="icon-list">
							<li th:if="${permission!=null?(permission%4>1):true}"><a class="add" href="0"><span class="btn">新增信息</span></a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		
		<table id="list">
			<thead>
				<tr><th bgcolor="#7b88b7" width="290">菜单名称</th><th bgcolor="#7b88b7" width="140">链接地址</th><th bgcolor="#7b88b7">排序</th><th bgcolor="#7b88b7">目标</th><th bgcolor="#7b88b7">权限标识</th><th bgcolor="#7b88b7" width="290">操作</th></tr>
			</thead>
			<tbody>
				<tr th:each="obj : ${@menuService.allMenus}" th:object="${obj}">
					<td style="text-align:left;">
						<span style="display:inline-block;" th:styleappend="'width:'+*{#strings.arraySplit(path,',').length-1}*20+'px'">&nbsp;</span>
						<span class="folder-line"></span>
						<span class="folder-open"></span>
						<span th:text="*{name}"></span>
					</td>
					<td th:text="*{href}"></td>
					<td th:text="*{sort}"></td>
					<td th:text="*{#strings.defaultString(target,'mainframe')}"></td>
					<td th:text="*{symbol}"></td>
					<td th:replace="common/index :: operation"></td>
				</tr>
			</tbody>
		</table>
		<script>
		$("#list").flexigrid({
			height:window.innerHeight-200
		});
		$("input[type=submit]").click(function(){
			$("input[name=page]").val(1);
		});
		function deleteObj(id){
			if(confirm("确认删除?")) location.href=id+"/delete";
		}
		</script>
	</body>
</html>